<?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class PressDirController extends DirController
{

	protected $getParams=array();
	

	public function renderHeader($action, $model)
	{
		$output=parent::renderHeader($action, $model);
		if ($action==='admin'){
			$output.=CHtml::label('Печатная машина','press');
			$output.=CHtml::activeDropDownList($model,'ut_press_id', array_merge(array(0=>'Не выбрано'),CHtml::listData(CActiveRecord::model('Press')->findAll(),'ut_press_id','ut_press_name')),
			array('onchange'=>"$.fn.yiiGridView.update('".strtolower($this->model.'-grid')."', {data: {'".$this->model."':{'ut_press_id':$(this).val()}}});"));
		}		
		return $output;
	}	
	
}